<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Pages extends CI_Controller{
//    public function index(){
//        $this->load->view('templates/header');
//	$this->load->view('pages/home');
//	$this->load->view('templates/footer');
//    }
    public function view($page = 'home'){
        if ( ! file_exists('application/views/pages/'.$page.'.php'))
	{
		// Whoops, we don't have a page for that!
            echo "Page : ".$page." Whoops, we don't have a page for that!";
		show_404();
	}
	
	$data['title'] = ucfirst($page); // Capitalize the first letter
	$this->load->library('parser');
	//$this->load->view('templates/header', $data);
//        $data = array(
//            'blog_title' => ucfirst($page),
//            'blog_heading' => 'My Blog Heading',
//            'blog_entries' =>'My entries',
//            'title' => 'Title 1',
//            'body' => $this->load->view('pages/'.$page, $data)
            /*/*'blog_entries' =>array(
                                      array('title' => 'Title 1', 'body' => 'Body 1'),
                                      array('title' => 'Title 2', 'body' => 'Body 2'),
                                      array('title' => 'Title 3', 'body' => 'Body 3'),
                                      array('title' => 'Title 4', 'body' => 'Body 4'),
                                      array('title' => 'Title 5', 'body' => 'Body 5')
                                      )*/
//            );

        //$this->parser->parse('layout', $data);
	$this->parser->parse('pages/'.$page, $data);
	//$this->load->view('templates/footer', $data);
    }
}
?>
